import java.io.BufferedReader;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.text.SimpleDateFormat;
import java.util.*;

import com.xr.common.Task;
import com.xr.hr.sys.OrgIns;
import com.xr.oa.remind.hrHomePageViewModel;
import com.xr.system.analyzingMax;
import com.bstek.dorado.common.ds.DataSourceConfig;
import com.bstek.dorado.common.ds.JdbcDataSourceConfig;


public class test  extends JdbcDataSourceConfig  {

	/**
	 * @param args 
	 */
	public String dd=":dd";
	public void setPassword(){
		
	}
	public static void main(String[] args) {
		String fileToBeRead="23xlssf2.xlsx";
		int idx=fileToBeRead.toUpperCase().lastIndexOf(".XLS");
		System.out.println(fileToBeRead.toUpperCase().substring(idx, fileToBeRead.length()));
		System.out.println("sd12d.xls333.xls121".toUpperCase().lastIndexOf(".XLS",33));
		//System.out.println("23343\"ddd\"234324".replaceAll("\"ddd", "111"));
	}
	 

public static String getMotherboardSN() {
	  String result = "";
	    try {
	      File file = File.createTempFile("realhowto",".vbs");
	      file.deleteOnExit();
	      FileWriter fw = new java.io.FileWriter(file);

	      String vbs =
	         "Set objWMIService = GetObject(\"winmgmts:\\\\.\\root\\cimv2\")\n"
	        + "Set colItems = objWMIService.ExecQuery _ \n"
	        + "   (\"Select * from Win32_BaseBoard\") \n"
	        + "For Each objItem in colItems \n"
	        + "    Wscript.Echo objItem.SerialNumber \n"
	        + "    exit for  ' do the first cpu only! \n"
	        + "Next \n";

	      fw.write(vbs);
	      fw.close();
	      Process p = Runtime.getRuntime().exec("cscript //NoLogo " + file.getPath());
	      BufferedReader input =
	        new BufferedReader
	          (new InputStreamReader(p.getInputStream()));
	      String line;
	      while ((line = input.readLine()) != null) {
	         result += line;
	      }
	      input.close();
	    }
	    catch(Exception e){
	        e.printStackTrace();
	    }
	    return result.trim();
	  }
 
}
